Repository navigation
feat: add a verify command for signed trust manifests - #67
Merged
Merged
Conversation
muscariello
force-pushed
the
feat/verify-command
branch
from
November 5, 2026 15:44
b2951d8 to
9e999f4
Compare
muscariello
changed the base branch from
feat/trust-manifests-spec-117
to
fix/cosign-tlog-opt-in
November 5, 2026 15:44
This was referenced Nov 5, 2026
`ai-catalog verify` checks each trust manifest of a catalog: the release binding to its entry, the signature object and its validity period, and the detached ES256 JWS under the did-web-v1 profile, resolving the signer's root did:web document with safe fetching. It reports publisher authority for urn:air entries and checks inline data against the entry digest. `--did-document DID=PATH` and `--offline` allow verification without network access; `--strict` treats inconclusive results as failures. Closes #63 Signed-off-by: Luca Muscariello <muscariello@ieee.org>
The did-web-v1 checks now live in ai-catalog-validate (see Agent-Card/ai-catalog-rust#61). Drop the CLI's own implementation and keep only what the library leaves to callers: a Fetch that follows the safe-fetching rules, with --did-document overrides and --offline, and the text and JSON reports. Refs #63 Signed-off-by: Luca Muscariello <muscariello@ieee.org>
Tests run in parallel, and time-based directory names could collide, so one test removed another's DID document. Signed-off-by: Luca Muscariello <muscariello@ieee.org>
Since ai-catalog-validate 0.4.0, structural validation reports at most Discoverable; only verification reports Trusted. Signed-off-by: Luca Muscariello <muscariello@ieee.org>
muscariello
force-pushed
the
feat/verify-command
branch
from
November 5, 2026 17:22
c9319de to
2508bcd
Compare
muscariello
marked this pull request as ready for review
November 5, 2026 18:44
msardara
previously approved these changes
Nov 5, 2026
Move the scheme and host checks into `checked_target`, which returns the parsed https URL that `fetch` then requests, and test it directly. The refusal test no longer passes an http URL into `fetch`, which CodeQL reported as a request over HTTP (rust/non-https-url). Refs #63 Signed-off-by: Luca Muscariello <muscariello@ieee.org>
msardara
approved these changes
Nov 6, 2026
lgecse
approved these changes
Nov 6, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack: #61 ← #65 ← #67 ← #66. Review and merge in that order; each PR shows only its own commits.
Closes #63. Needs Agent-Card/ai-catalog-rust#61.
What
ai-catalog verifydoesIt validates the catalog and runs
ai_catalog_validate::verify(from Agent-Card/ai-catalog-rust#61) on the document as served, then prints a report:did-web-v1signature (signer, protected header,assertionMethodkey in the signer's rootdid:webdocument, validity period, ES256 detached JWS) and the release binding of itssubjectto the entry.digest.The checks live in the library. The CLI supplies only what the library leaves to callers:
Fetch: HTTPS only, no redirects, 10 s timeout, 16 MiB limit. It refuses IP-literal hosts and private, loopback, link-local, CGNAT, unique-local and IPv4-mapped-private addresses, and pins the checked addresses for the connection.--did-document DID=PATH: serves a local DID document for that DID'shttps://<domain>/.well-known/did.json. Only rootdid:webDIDs are accepted.--offline: fetches nothing; checks that would need a fetch come backunverifiable.--jsonfor a structured report.Exit codes:
1if the catalog is invalid or any check fails;--strictalso fails onunverifiable.History
Later commits give each
verifytest its own temporary directory (parallel tests could share a time-based name) and update the README:validatenow reports at most Discoverable, andverifyreports Trusted.The first commit implemented the checks inside the CLI. The second replaces them with the library's
verify(), once Agent-Card/ai-catalog-rust#61 turned out to provide the same checks, so they live in one place.Dependencies
ai_catalog_validate::verifyshipped in ai-catalog-rust 0.4.0, and #61 here is bumped to it, so this builds against released crates and CI passes.Testing
Tested against the released 0.4.0 crates.
data, DID document supplied locally):conformance: trustedand exits 0;--strict;--did-documentDID is rejected.cargo testpasses (67 + 37);cargo clippy --all-targets --all-features -- -D warningsandcargo fmt --checkare clean.